﻿using System.Windows.Forms;

namespace OpenProgramUpdateSDK
{
    /// <summary>
    /// 更新管理器，负责下载更新、过滤文件、更新后启动主程序
    /// </summary>
    interface IUpdateManager
    {
        /// <summary>
        /// 第一步初始化
        /// </summary>
        /// <param name="ProgramPath"></param>
        /// <param name="ChannelName"></param>
        /// <param name="ForbiddenFiles"></param>
        /// <param name="ProgressBarObject"></param>
        /// <param name="Host"></param>
        /// <param name="port"></param>
        void Init(string ProgramPath,string ChannelName,string[] ForbiddenFiles,ProgressBar ProgressBarObject, string Host=null,int port = 80);

        /// <summary>
        /// 第二步杀掉进程，防止更新文件冲突
        /// </summary>
        void KillProess(string ProgramName);

        /// <summary>
        /// 如果你需要更新后打开程序，请在更新前执行本方法，启动程序的路径要在调用Init方法时设置“ProgramPath”
        /// </summary>
        void SetLaunchAfterUpdate();

        /// <summary>
        /// 第三步开始更新
        /// </summary>
        void UpdateStart();
        
    }
}
